package com.example.oj.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.example.oj.entity.Question;
import com.example.oj.entity.dto.question.QuestionQueryRequest;
import com.example.oj.entity.vo.QuestionVO;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * @description question(题目) Service
 * @createDate 2023-10-25 21:42:23
 */
public interface QuestionService extends IService<Question> {

  /**
   * 获取题目封装
   * @param question
   * @return
   */
  QuestionVO getQuestionVO(Question question);

  /**
   * 根据题目id获取题目封装
   * @param questionId
   * @return
   */
  QuestionVO getQuestionVOById(Long questionId);

  /**
   * 获取题目分页列表VO
   * @param questionPage
   * @return
   */
  Page<QuestionVO> getQuestionVOPage(Page<Question> questionPage);

  /**
   * 获取题目分页列表
   */
  List<Question> getQuestionPage(QuestionQueryRequest questionQueryRequest);

  /**
   * 更新题目的已通过数量
   * @param questionId
   */
  void updateQuestionNum(Long questionId);

  public Page<QuestionVO> listPageCompetitionQuestionVO(Long competitionId);

  void updateCompetitionId(List<Long> questionList, Long id);

  void removeCompetitionId(Long id);

  void updateQuestionIsQueried(Long id);
}
